package Lesson.Student.arrayListDemo;

import Domain.Student;

import java.util.ArrayList;

public class Demo4 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();

        list.add(new Student("戴嘉伟",40));
        list.add(new Student("王师傅",60));
        list.add(new Student("驴  哥",30));

        for (int i = 0; i < list.size(); i++) {
            Student stu = list.get(i);
            System.out.println(stu.getName()+"..."+stu.getAge());
        }
    }
}
